/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.wiai.untl.core.dao.jpa;

import com.wiai.untl.core.dao.DepartemenDAO;
import com.wiai.untl.core.entity.Departemen;
import com.wiai.untl.core.entity.Fakultas;
import java.util.List;

/**
 *
 * @author Hendro Steven
 */
public class DepartemenDAOImpl extends GeneralDAOImpl implements DepartemenDAO{

    @Override
    public List<Departemen> getAllDepartemen() {
        return getJpaTemplate().find("SELECT d FROM Departemen d");
    }

    @Override
    public List<Departemen> getByFakultas(Fakultas fakultas) {
        return getJpaTemplate().find("SELECT d FROM Departemen d WHERE d.fakultas=?1", fakultas);
    }

    @Override
    public Departemen getById(long id) {
        return (Departemen)getJpaTemplate().find(Departemen.class, id);
    }
    
}
